package cn.tedu._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator {

    @Override
    public int add(int m, int n) {
//        System.out.println("[日志]add方法开始...");
        int result = m + n;
        System.out.println("方法内部输出：" + result);
//        System.out.println("[日志]add方法结束...");

        return result;
    }

    @Override
    public int sub(int m, int n) {
//        System.out.println("[日志]sub方法开始...");
        int result = m - n;
        System.out.println("方法内部输出：" + result);
//        System.out.println("[日志]sub方法结束...");
        return result;
    }

    @Override
    public int mul(int m, int n) {
//        System.out.println("[日志]mul方法开始...");
        int result = m * n;
        System.out.println("方法内部输出：" + result);
//        System.out.println("[日志]mul方法结束...");
        return result;
    }

    @Override
    public int div(int m, int n) {
//        System.out.println("[日志]div方法开始...");
        int result = m / n;
        System.out.println("方法内部输出：" + result);
//        System.out.println("[日志]div方法结束...");
        return result;
    }

}
